{% extends 'master/base.html' %}

{% block htmlhead %}
    {% load html_tools %}
    {{ 'manage/act_lec.css'|as_css }}
{% endblock %}

{% block content %}
<form method="POST" action="{% url 'lecture:manage' %}?page={{ page.number }}">
{% csrf_token %}
{% with formset=page.formset %}
{{ formset.management_form }}

    {% for form in formset %}
        <div class="act_lec_add">
            <div class="line"></div>
            <li>
                <label>标题</label>
                {{ form.title }}
                <span class="error">
                    {% for error in form.title.errors %}
                        {{ error }}&nbsp;
                    {% endfor %}
                </span>  
            </li>
            <div class="line"></div>
            <li>
                <label>地点</label>
                {{ form.place }}
                <span class="error">
                    {% for error in form.place.errors %}
                        {{ error }}&nbsp;
                    {% endfor %}
                </span>  
            </li>
            <div class="line"></div>
            <li>
                <label>日期</label>
                {{ form.date }}
                <span class="error">
                    {% for error in form.date.errors %}
                        {{ error }}&nbsp;
                    {% endfor %}
                </span>  
            </li>
            <div class="line"></div>
            <li>
                <label>时间</label>
                {{ form.time }}
                <span class="error">
                    {% for error in form.time.errors %}
                        {{ error }}&nbsp;
                    {% endfor %}
                </span>  
            </li>
            <div class="line"></div>
            <li>
                <label>发言人</label>
                {{ form.speaker }}
                <span class="error">
                    {% for error in form.speaker.errors %}
                        {{ error }}&nbsp;
                    {% endfor %}
                </span>  
            </li>
            <div class="line"></div>
            <li>
                <label>网址</label>
                {{ form.url_id }}
                {% if form.url_id.value %}
                <a href="http://www.szu.edu.cn/board/view.asp?id={{ form.url_id.value }}" class="szu_url" target="_blank">查看校内网</a>
                {% endif %}
                <span class="error">
                    {% for error in form.url_id.errors %}
                        {{ error }}&nbsp;
                    {% endfor %}
                </span>  
            </li>
            <div class="line"></div>
            <li>
                <label>已核</label>
                {{ form.checked }}
                <label>删除</label>
                {{ form.DELETE }}
            </li>
        </div>
        {{ form.id }}   
    {% endfor %}
{% endwith %}
    <input type="submit" value="提交" class="add" style="margin-bottom:75px;" />
</form>

{% include 'plugin/paginator.html' with page=page %}
    
{% endblock %}
